const connection = require("../db/connection")
const input = require("scanline")
const jiancha = require("./jiancha")

async function deleteOne() {
    const mc = await input("请输入你要删除的商品名称：")
  jiancha(mc)
    connection.query("delete from sp where 名称 = ?", [mc], (error, _) => {
        if (error) {
            console.log("删除商品信息失败", error)
            process.exit(1)
        }
        console.log("你已删除商品信息");
    })

    connection.end()
}

module.exports = deleteOne


